﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;


public partial class welcom : System.Web.UI.Page
{
    DBHelper db = new DBHelper();

    public int wd_1_html = 0;
    public int wd_2_html = 0;
    public int wd_3_html = 0;
    public int wd_4_html = 0;
    public int wd_5_html = 0;



    protected void Page_Load(object sender, EventArgs e)
    {
        lblName.Text = Session[AppConfig.SESSION_USER_NAME].ToString();
        getdata();
    }


    public void getdata()
    {
        string userbh = Session[AppConfig.SESSION_USER_BH].ToString();
        string sql = "select * from A_Eval_Sys where [state]=0";
        DataTable dt = db.getList(sql);
        int year = Convert.ToInt32(dt.Rows[0]["year"].ToString());
        int kp_year = year;
        int month = Convert.ToInt32(dt.Rows[0]["month"].ToString());
        int kp_month = month;
        string zx_psid = Session[AppConfig.SESSION_USER_PSID].ToString();  


        wd_1_html = db.getCount("A_Task", "state=0  and Ry_Kh='" + zx_psid + "'  and year='" + kp_year + "' and month='" + kp_month + "'");
        wd_2_html = db.getCount("A_Task", "state=0  and Ry_Bkh='" + zx_psid + "'  and year='" + kp_year + "' and month='" + kp_month + "'");
        wd_3_html = db.getCount("A_Task", "state=1  and Ry_Kh='" + zx_psid + "'  and year='" + kp_year + "' and month='" + kp_month + "' order by id desc");
        wd_4_html = db.getCount("A_Task", "state=1  and Ry_Bkh='" + zx_psid + "'  and year='" + kp_year + "' and month='" + kp_month + "'");
        wd_5_html = db.getCount("A_Task", "Ry_Kh='" + zx_psid + "' and state=2  and year='" + kp_year + "' and month='" + kp_month + "'");

    }


}